package br.com.peri.exception;

import java.util.ArrayList;
import java.util.List;

public class PeriRepositoryException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	private List<String> messages;

	public PeriRepositoryException() {
		super();
	}

	public PeriRepositoryException(String message, Throwable cause) {
		super(message, cause);
	}

	public PeriRepositoryException(String message) {
		super(message);
	}

	public PeriRepositoryException(Throwable cause) {
		super(cause);
	}

	public void addMessage(String msg) {
		if (messages == null) {
			messages = new ArrayList<String>();
		}
		messages.add(msg);
	}

	public List<String> getMessages() {
		return messages;
	}

	public void setMessages(List<String> messages) {
		this.messages = messages;
	}

}
